package com.zlf.po;

import lombok.Getter;

import java.math.BigDecimal;

public class WalletTransaction {
    @Getter
    private Long createTime;
    @Getter
    private Long fromWalletId;
    @Getter
    private Long toWalletId;
    @Getter
    private BigDecimal transactionAmount;
    @Getter
    private Boolean isConfirmed=true;
    private Integer transferId;
    public WalletTransaction(Long fromWalletId,Long toWalletId,BigDecimal transactionAmount){
        this.fromWalletId=fromWalletId;
        this.toWalletId=toWalletId;
        this.transactionAmount=transactionAmount;
        this.createTime= System.currentTimeMillis();
    }
    public void tobeconfirm(){
        this.isConfirmed=false;
    }
    public void confirm() throws Exception {
        if(isConfirmed){
            throw new Exception("订单已被确认！");
        }
    }

}
